<template>
  <el-input
    v-model="userid"
    @blur="idjudge(userid)"
  />
</template>

<script>
export default {
  name: "idJudge",
  data() {
    return {
      userid: "",
    };
  },
  methods: {
    idjudge(userid) {
      var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
      if (reg.test(userid) === false) {
        console.log("false");
        console.log(this.value);
        return false;
      } else {
        console.log("true");
        return true;
      }
    },
  },
};
</script>

<style>
</style>